#define _CRT_SECURE_NO_WARNINGS 1

#include "Heap.h"

void TestAdJustUpCreatHeap()
{
	HPDataType a[] = { 1, 3, 2, 6, 7, 9, 5, 8, 4 };
	size_t aSize = sizeof(a) / sizeof(int);

	for (int i = 1; i < aSize; i++)
	{
		AdJustUp(&a, i);
	}
	int n = aSize;
	while (n > 1)
	{
		HeapPop(&a, &n);
	}

}

void TestAdJustDownCreatHeap()
{
	HPDataType a[] = { 1, 3, 2, 6, 7, 9, 5, 8, 4 };
	size_t aSize = sizeof(a) / sizeof(int);

	for (int i = (aSize - 2) / 2; i > 0; i--)
	{
		AdJustDown(&a, aSize - 1, i);
	}
	int n = aSize;
	while (n > 1)
	{
		HeapPop(&a, &n);
	}
}

int main()
{
	TestAdJustUpCreatHeap();
	TestAdJustDownCreatHeap();
	return 0;
}